package com.woniuxy02;

public class Student {
    //属性，成员变量
    String name;
    int age;
    String gender;

    public Student(){
        System.out.println("使用自定义无参构造器，初始化对象的属性");
        name="zs";
        age=18;
        gender="male";
    }

    //局部变量
    public Student(String name,int age,String gender){
        System.out.println("使用自定义带参构造器，初始化对象的属性");
        //代表当前类的对象
        this.name=name;
        this.age=age;
        this.gender=gender;
    }


    public void Stuent(){
        System.out.println("非构造方法Student");
    }

    public String getInfo(){
        return  "name:"+this.name+",age:"+age+",gender:"+gender;
    }

    public void show(){
//        String str = this.getInfo();
        String str = getInfo();
        System.out.println(str);
    }


}
